package com.shilox.android.app.logitnow.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.shilox.android.app.logitnow.R;

public class WelcomeFragment extends Fragment implements OnClickListener {
	ImageView addImage;
	ImageView browseImage;

	public static final WelcomeFragment newInstance(String message) {
		WelcomeFragment f = new WelcomeFragment();
		return f;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View v = inflater.inflate(R.layout.welcome_layout, container, false);

		addImage = (ImageView) v.findViewById(R.id.addImage);
		browseImage = (ImageView) v.findViewById(R.id.browseImage);
		addImage.setOnClickListener(this);
		browseImage.setOnClickListener(this);
		return v;
	}

	@Override
	public void onClick(View v) {
		ViewPager vp;
		switch (v.getId()) {
		case R.id.addImage:
			// Display success information
			vp = (ViewPager) getActivity().findViewById(R.id.viewpager);
			vp.setCurrentItem(0);
			break;
		case R.id.browseImage:
			vp = (ViewPager) getActivity().findViewById(R.id.viewpager);
			vp.setCurrentItem(2);
			break;
		}

	}
}
